package com.zpark.entity.patients;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;

/**
 * 患者生命体征记录表
 * @TableName patient_vitals
 */
@TableName(value ="patient_vitals")
@Data
public class PatientVitals implements Serializable {
    /**
     * 记录ID
     */
    @TableId(value = "record_id", type = IdType.AUTO)
    private Long recordId;

    /**
     * 患者ID
     */
    @TableField(value = "patient_id")
    private Long patientId;

    /**
     * 患者姓名
     */
    @TableField(value = "patient_name")
    private String patientName;

    /**
     * 体温(℃)
     */
    @TableField(value = "temperature")
    private BigDecimal temperature;

    /**
     * 心率(bpm)
     */
    @TableField(value = "pulse")
    private Integer pulse;

    /**
     * 收缩压(mmHg)
     */
    @TableField(value = "systolic_pressure")
    private Integer systolicPressure;

    /**
     * 舒张压(mmHg)
     */
    @TableField(value = "diastolic_pressure")
    private Integer diastolicPressure;

    /**
     * 血氧饱和度(%)
     */
    @TableField(value = "oxygen_saturation")
    private Integer oxygenSaturation;

    /**
     * 是否全部指标正常
     */
    @TableField(value = "is_normal")
    private Integer isNormal;

    /**
     * 异常指标(逗号分隔)
     */
    @TableField(value = "abnormal_indicators")
    private String abnormalIndicators;

    /**
     * 记录时间
     */
    @TableField(value = "record_time")
    private Date recordTime;

    /**
     * 创建时间
     */
    @TableField(value = "created_at")
    private Date createdAt;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        PatientVitals other = (PatientVitals) that;
        return (this.getRecordId() == null ? other.getRecordId() == null : this.getRecordId().equals(other.getRecordId()))
            && (this.getPatientId() == null ? other.getPatientId() == null : this.getPatientId().equals(other.getPatientId()))
            && (this.getPatientName() == null ? other.getPatientName() == null : this.getPatientName().equals(other.getPatientName()))
            && (this.getTemperature() == null ? other.getTemperature() == null : this.getTemperature().equals(other.getTemperature()))
            && (this.getPulse() == null ? other.getPulse() == null : this.getPulse().equals(other.getPulse()))
            && (this.getSystolicPressure() == null ? other.getSystolicPressure() == null : this.getSystolicPressure().equals(other.getSystolicPressure()))
            && (this.getDiastolicPressure() == null ? other.getDiastolicPressure() == null : this.getDiastolicPressure().equals(other.getDiastolicPressure()))
            && (this.getOxygenSaturation() == null ? other.getOxygenSaturation() == null : this.getOxygenSaturation().equals(other.getOxygenSaturation()))
            && (this.getIsNormal() == null ? other.getIsNormal() == null : this.getIsNormal().equals(other.getIsNormal()))
            && (this.getAbnormalIndicators() == null ? other.getAbnormalIndicators() == null : this.getAbnormalIndicators().equals(other.getAbnormalIndicators()))
            && (this.getRecordTime() == null ? other.getRecordTime() == null : this.getRecordTime().equals(other.getRecordTime()))
            && (this.getCreatedAt() == null ? other.getCreatedAt() == null : this.getCreatedAt().equals(other.getCreatedAt()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getRecordId() == null) ? 0 : getRecordId().hashCode());
        result = prime * result + ((getPatientId() == null) ? 0 : getPatientId().hashCode());
        result = prime * result + ((getPatientName() == null) ? 0 : getPatientName().hashCode());
        result = prime * result + ((getTemperature() == null) ? 0 : getTemperature().hashCode());
        result = prime * result + ((getPulse() == null) ? 0 : getPulse().hashCode());
        result = prime * result + ((getSystolicPressure() == null) ? 0 : getSystolicPressure().hashCode());
        result = prime * result + ((getDiastolicPressure() == null) ? 0 : getDiastolicPressure().hashCode());
        result = prime * result + ((getOxygenSaturation() == null) ? 0 : getOxygenSaturation().hashCode());
        result = prime * result + ((getIsNormal() == null) ? 0 : getIsNormal().hashCode());
        result = prime * result + ((getAbnormalIndicators() == null) ? 0 : getAbnormalIndicators().hashCode());
        result = prime * result + ((getRecordTime() == null) ? 0 : getRecordTime().hashCode());
        result = prime * result + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", recordId=").append(recordId);
        sb.append(", patientId=").append(patientId);
        sb.append(", patientName=").append(patientName);
        sb.append(", temperature=").append(temperature);
        sb.append(", pulse=").append(pulse);
        sb.append(", systolicPressure=").append(systolicPressure);
        sb.append(", diastolicPressure=").append(diastolicPressure);
        sb.append(", oxygenSaturation=").append(oxygenSaturation);
        sb.append(", isNormal=").append(isNormal);
        sb.append(", abnormalIndicators=").append(abnormalIndicators);
        sb.append(", recordTime=").append(recordTime);
        sb.append(", createdAt=").append(createdAt);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}